import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import http from "./utils/service"
import resetcss from 'components/reset.css'
import fastClick from 'fastclick';

//解决300ms点击延迟
fastClick.attach(document.body);

import {
  Lazyload,
  Tabbar,
  TabbarItem,
  NavBar,
  Search,
  Grid,
  GridItem,
  Image,
  SwipeItem,
  Swipe,
  Row,
  Col,
  Tab,
  Tabs,
  Button,
  Icon,
  GoodsAction,
  GoodsActionIcon,
  GoodsActionButton,
  Toast,
  Card,
  Stepper,
  SubmitBar,
  Checkbox,
  CheckboxGroup,
  Panel,
  Dialog,
  Field,
  Cell,
  CellGroup,
  ContactCard,
  ContactList,
  ContactEdit,
  Popup,
  AddressList,
  AddressEdit,
  NoticeBar,
  TreeSelect,
  Collapse,
  CollapseItem

} from 'vant'


//引入折叠面板
Vue.use(Collapse).use(CollapseItem);


// 引入侧边分类栏
Vue.use(TreeSelect);

//通知栏
Vue.use(NoticeBar)

//地址编辑
Vue.use(AddressEdit);

//地址列表引入
Vue.use(AddressList);

//弹出层
Vue.use(Popup);

//引入编辑地址，添加地址，删除地址
Vue
  .use(ContactCard)
  .use(ContactList)
  .use(ContactEdit);

//引入单元格
Vue.use(Cell).use(CellGroup);

//引入登录注册界面模板
Vue.use(Field);

//引入弹窗确认
Vue.use(Dialog);

//引入panel面板
Vue.use(Panel);

//引入check
Vue.use(Checkbox).use(CheckboxGroup);

//引入提交订单
Vue.use(SubmitBar)

//引入步进器
Vue.use(Stepper)

//引入加入购物车弹窗
Vue.use(Card)

//引入轻提示
Vue.use(Toast)

//引入底部加入购物车啥啥的
Vue.use(GoodsAction).use(GoodsActionIcon).use(GoodsActionButton);

//引入icon
Vue.use(Icon)

//引入全局button
Vue.use(Button)

//引入全局resetcss
Vue.use(resetcss);

//引入tab切换
Vue.use(Tab).use(Tabs);

//引入layout布局
Vue.use(Row).use(Col);

//引入swipe
Vue.use(Swipe).use(SwipeItem);

//引入img插件
Vue.use(Image);

//引入宫格
Vue.use(Grid).use(GridItem);

//引入头部搜索
Vue.use(Search);

//引入loading
import loading from "./utils/loading";
Vue.use(loading);

//Tabbar标签栏
Vue.use(Tabbar).use(TabbarItem);

//引入NavBar头部
Vue.use(NavBar);

//懒加载
Vue.use(Lazyload, {
  preLoad: 1.3,
  error: '/yao_middle.gif',
  loading: '/lazy.gif',
  attempt: 3
});

//axios-http
Vue.prototype.$http = http;

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')